using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace GodSoft.Models.Mapping
{
    public class DeviceTypeMap : EntityTypeConfiguration<DeviceType>
    {
        public DeviceTypeMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.Type_Name)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.Provider)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("DeviceType");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Type_Name).HasColumnName("Type_Name");
            this.Property(t => t.Provider).HasColumnName("Provider");
        }
    }
}
